Local and Remote Login Lab

1. Use SSH Key-based Authentication

In this lab, you set up SSH key-based authentication to initiate SSH connections.

  1. Create an SSH key pair as student on desktop1.example.com using no passphrase.

    [student@desktop1 ~]$ ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/student/.ssh/id_rsa):Enter
    Created directory '/home/student/.ssh'.
    Enter passphrase (empty for no passphrase):Enter
    Enter same passphrase again:Enter
    Your identification has been saved in /home/student/.ssh/id_rsa.
    Your public key has been saved in /home/student/.ssh/id_rsa.pub.
    ...
  2. Send the SSH public key to the student account on server1.example.com.

    [student@desktop1 ~]$ ssh-copy-id server1.example.com
    The authenticity of host 'server1.example.com.(192.168.0.101)' can't be established.
    ECDSA key fingerprint is 33:a:a1:3c:98:30:ff:f6:d4:99:00:4e:7f:84:3e:c3.
    Are you sure you want to continue connecting (yes/no)? yes
    /usr/bin/ssh-copy-id:INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id:INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    student@server1.example.com's password:r3dh@t1!
    
    Number of key(s) added:1
    
    Now try logging into the machine, with:  "ssh student@server1.example.com"
    and check to make sure that only the key(s) you wanted were added.
  3. Run the hostname command by using ssh to display the hostname of the server1.example.com machine without the need to enter a password.

    [student@desktop1 ~]$ ssh server1.example.com 'hostname'
    server1.example.com

2. Create and View an SoS Report

In this lab, you use the sosreport command to generate an SoS report, and then view the contents of that diagnostic archive.

  1. On server1.example.com, switch to the root user:

    [student@server1 ~]$ su -
    Password:r3dh@t1!
  2. Run the sosreport command. This may take many minutes on larger systems.

    [root@server1 ~]# sosreport
    
    sosreport (version 3.0)
    
      This command will collect system configuration and
    diagnostic information from this Red Hat Enterprise Linux
    system. An archive containing the collected information
    will be generated in /var/tmp and may be provided to a Red
    Hat support representative or used for local diagnostic or
    recording purposes.
    
      Any information provided to Red Hat will be treated in
    strict confidence in accordance with the published support
    policies at:
    
        https://access.redhat.com/support/
    
      The generated archive may contain data considered
    sensitive and its content should be reviewed by the
    originating organization before being passed to any third party.
    
      No changes will be made to system configuration.
    
    Press ENTER to continue, or CTRL-C to quit. ENTER
    
    Please enter your first initial and last name [server1.example.com]:yourname
    Please enter the case number that you are generating this report for:01034421
  3. Press Enter and provide the requested information. Make up a value for the case number.

    Running 17/74:general...
    Creating compressed archive...
    
    Your sosreport has been generated and saved in:
    /var/tmp/sosreport-yourname.01034421-20140129000049.tar.xz
    
    The checksum is:b2e78125290a4c791162e68da8534887
    
    Please send this file to your support representative.
  4. Change directory to /var/tmp, and unpack the archive.

    [root@server1 ~]# cd /var/tmp
    [root@server1 tmp]# tar -xvJf sosreport-*.tar.xz
  5. Change directory to the resulting subdirectory and browse the files found there.

    [root@server1 ~]# cd sosreport-yourname.01034421-20140129000049
    [root@server1 sosreport-yourname.01034421-20140129000049]# ls -lR
  6. Open files, list directories, and continue to browse to become familiar with the information included in SoS reports.

    When creating a support case, you would attach the original archived and compressed file as diagnostic information.
  7. When you are finished exploring the SoS report, remove the archive directory and files and return to your home directory.

    [root@server1 sosreport-yourname.01034421-20140129000049]# cd /var/tmp
    [root@server1 tmp]# rm -rf sosreport*
    [root@server1 tmp]# exit
    [student@server1 ~]$